import SettleInfo from './SettleInfo';
import GoodsInfo from './GoodsInfo';
import AddressInfo from "./AddressInfo";
import LoggerUtil from '@/utils/LoggerUtil';
import DateUtil from '@/utils/DateUtil';
import User from '@/pages/tabbar/user/profile';
import { UserInfo } from './UserInfo';

export default class OrderInfo{
    public static STATUS_PAYING = 1;
    public static STATUS_PAIED = 2;
    public static STATUS_REFUND = 3;
    public static STATUS_DELIVERY = 6;
    public static STATUS_RECEIVED = 7;
    public static STATUS_COMMENTED = 9;
    public static STATUS_CANCELED = 5;

    id:number;
    deliTime:string;
    settle = new SettleInfo();
    goods = new Array<GoodsInfo>();
    address = new AddressInfo();
    status:number=1;
    createTime:string='2020-08-13';
    deliveryMethod:number=2;
    statusDesc:string="";
    user = new UserInfo.User();
    initDeliveryTime(){
        let  date = new Date();
        let time = date.getTime();
        date.setTime(time+30*60*1000);

        this.deliTime = date.getHours()+":"+date.getMinutes();
    }
    public static getStatusDesc(status:number){
        if(status==OrderInfo.STATUS_PAYING){
            return '待付款';
        }
        if(status==OrderInfo.STATUS_PAIED){
            return '已付款';
        }
        if(status==OrderInfo.STATUS_RECEIVED){
            return '已收货';
        }
        if(status==OrderInfo.STATUS_COMMENTED){
            return '已评价';
        }
        if(status==OrderInfo.STATUS_CANCELED){
            return '已取消';
        }
        if(status==OrderInfo.STATUS_DELIVERY){
            return '配送中';
        }
        if(status==OrderInfo.STATUS_REFUND){
            return '已退款';
        }
    }    
}